#coding=utf-8
#!/usr/bin/python

import os, sys, string,time



import time
import datetime 


#oracle   用我自己写的
#D:\python2.6.6\dev_test

#import pdb
#a = "aaa"
#pdb.set_trace()

try:
    import db_oracle    as me_db
except Exception, e:
    print e
    print 'error: ' ,__file__
    sys.exit()



db = me_db.db_cls()
db.do_init()

"""
sql = u" insert into ot (id,name,sday ,age) values(11,'小红d',to_date('1992-10-21','yyyy-mm-dd'),'21.3') "

db.do_sql(sql)
"""

sql = u" select * from ot "
list = db.get_all(sql)

loop_init = 0
for  row in list:
    row_str = ''
    if loop_init is 0 :
       loop_init = 1
       clu_list = ["%s" % clu for clu in row.keys()  ] 
       row_str +=  '-----'.join( clu_list ) + "\n"
    row_list =  [ "%s" % row[val] for val in row.keys()  ]
    row_str +=  '-----'.join( row_list ) 
    print row_str 



    
if __name__ == '__main__':
    print 'natural exit!'
    print  datetime.datetime.now()





